* @param $info array|null
* @throws MWException
*/
- function __construct( array $info = null ) {
+ public function __construct( array $info = null ) {
// Verify required settings presence
if(
$info === null
: array();
// Give defaults for the basic zones...
foreach ( array( 'public', 'thumb', 'temp', 'deleted' ) as $zone ) {
- if ( !isset( $this->zones[$zone] ) ) {
- $this->zones[$zone] = array(
- 'container' => "{$this->name}-{$zone}",
- 'directory' => '' // container root
- );
+ if ( !isset( $this->zones[$zone]['container'] ) ) {
+ $this->zones[$zone]['container'] = "{$this->name}-{$zone}";
+ }
+ if ( !isset( $this->zones[$zone]['directory'] ) ) {
+ $this->zones[$zone]['directory'] = '';
}
}
}
* @return String or false
*/
public function getZoneUrl( $zone ) {
+ if ( isset( $this->zones[$zone]['url'] )
+ && in_array( $zone, array( 'public', 'temp', 'thumb' ) ) )
+ {
+ return $this->zones[$zone]['url']; // custom URL
+ }
switch ( $zone ) {
case 'public':
return $this->url;
/**
* Get the public root URL of the repository
*
+ * @deprecated since 1.20
* @return string
*/
public function getRootUrl() {
- return $this->url;
+ return $this->getZoneUrl( 'public' );
}
/**